package com.leyou.springlistener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationRunListener;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

@Slf4j
public class MySpringApplicationRunListener implements SpringApplicationRunListener {

    public MySpringApplicationRunListener(SpringApplication springApplication,String []args) {

    }


    @Override
    public void starting() {

        log.info("======starting======");
    }



    @Override
    public void environmentPrepared(ConfigurableEnvironment environment) {

        log.info("======environmentPrepared======");
    }


    @Override
    public void contextPrepared(ConfigurableApplicationContext context) {

        log.info("======contextPrepared======");
    }


    @Override
    public void contextLoaded(ConfigurableApplicationContext context) {

        log.info("======contextLoaded======");
    }


    @Override
    public void started(ConfigurableApplicationContext context) {

        log.info("======started======");
    }


    @Override
    public void running(ConfigurableApplicationContext context) {

        log.info("======running======");
    }


    @Override
    public void failed(ConfigurableApplicationContext context, Throwable exception) {


        log.info("======failed======");
    }
}
